var form,$,table,layer;
var user = JSON.parse(localStorage.getItem('user'));
layui.use(['form','jquery','table','layer'],function() {
    form = layui.form;
    $ = layui.$;
    table = layui.table;
    layer = layui.layer;

    getToExamineCourseMessages();
});
function getToExamineCourseMessages(){
    var courseId = $('#proId',window.parent.document).val();
    $.ajax({
        url:'/toExamine/getToExamineCourseById',
        dataType:'json',
        data:{"courseId": courseId},
        success:function (data) {
            data = data.data;
            console.log(data);
            $('input[name = id]').val(data.id);
            $('input[name = courseName]').val(data.courseName);
            $('input[name = title]').val(data.title);
            if(data.courseStatus == 2){
                data.courseStatus = "上架";
            }else if(data.courseStatus == 3){
                data.courseStatus = "下架";
            }
            $('input[name = courseStatus]').val(data.courseStatus);
            $('input[name = saleNum]').val(data.saleNum);
            $('input[name = courseLabel]').val(data.title);
            $('input[name = likeNum]').val(data.likeNum);
            $('input[name = collectNum]').val(data.collectNum);
            $('input[name = courseNprice]').val(data.courseNprice);
            $('#courseIntro').val(data.courseIntro);
            if (data.url != ''){
                $('#url').html('<img src='+data.url+' style="float:left; width:155px;"/>');
            }
        }
    });
}